<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('修改分类')}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
    <form class="form-horizontal m" id="form-category-edit" th:object="${category}">
        <input name="categoryId" th:field="*{categoryId}" type="hidden">
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-sm-right">上级</label>
            <div class="col-sm-5">
                <div class="input-group">
                    <input class="form-control" type="text"  th:value="${parentCategory!=null?parentCategory.categoryName:'无'}" disabled="disabled">
                </div>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-sm-right">专业</label>
            <div class="col-sm-5">
                <div class="input-group">
                    <input class="form-control" type="text"  th:value="${category.subjectName!=null?category.subjectName:'无'}" disabled="disabled">
                </div>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-sm-right is-required">类别名称</label>
            <div class="col-sm-8">
                <input name="categoryName" th:field="*{categoryName}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-sm-right">排序</label>
            <div class="col-sm-3">
                <input name="sort" th:field="*{sort}" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:insert="~{include :: footer}" />
<script type="text/javascript">
    var prefix = "/category";
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit.json", $('#form-category-edit').serialize());
        }
    }
</script>
</body>
</html>